<template>
  <div>
    <el-table
      :data="data"
      border
      style="width: 100%"
    >
      <el-table-column
        prop="id"
        label="积分策略编码">
      </el-table-column>

      <el-table-column
        label="积分策略具体信息"
      >
        <template scope="scope">
          <div>
            <p>1积分={{scope.row.unitPointValue}}元<br> 最高抵{{(scope.row.maxRatio * 100)}}%</p>

          </div>
        </template>
      </el-table-column>

      <el-table-column
        label="关联商品"
      >
        <template scope="scope">
          <div v-if='scope.row.productList.length > 0'>
            <p
              v-for='(item,$index) in scope.row.productList'
            >{{item.productId}} {{item.productTitle}}</p>
          </div>
          <div v-else>
            <p>暂无</p>
          </div>
        </template>
      </el-table-column>

      <el-table-column label="生效时间" width='400'>
        <template scope="scope">
          <div v-if='scope.row.timeList.length > 0'>
            <p
              v-for='(item,$index) in scope.row.timeList'
            >{{$index+1}}.&nbsp;&nbsp;{{item['startTime'] | dateformat}} 至 {{item['endTime'] | dateformat}}</p>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="活动状态">
        <template scope='scope'>
          {{scope.row.status | displayIntegralStatusContent}}
        </template>
      </el-table-column>

      <el-table-column
        label="操作">
        <template scope="scope">
          <p>
            <el-button size="small"
              @click="edit(scope.row.id)"
            >编辑</el-button>
          </p>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
  export default {
    props: {
      'data': {
        type: Array,
        required: true
      }
    },
    data () {
      return {
      }
    },
    methods: {
      edit (id) {
        this.$router.push({
          path: '/operational/integralEdit',
          query: {
            type: 'edit',
            id: id
          }
        })
      }
    },
    components: {
      // activitiesBtnGroup
    }
  }
</script>

